const mongoose = require('mongoose')
const { dbHost } = require('../../conf/index')
const { generateId } = require('../../utils/index')

const connection = mongoose.createConnection(`mongodb://${dbHost}/manage_db`)

const Schema = mongoose.Schema

const songerSchema = new Schema({
  songerNo: {
    type: String,
    default() {
      return generateId('GS')
    }
  },
  songerImg: { type: String, default: '' }, //头像
  name: {
    type: String,
    default() {
      return '' //
    }
  }, //昵称
  city: { type: Array, default: [] }, //地区
  birthDay: { type: String, default: '' }, //生日
  sex: { type: Number, default: 1 }, //1代表男，0代表女
  img_url: { type: String, default: '' }, // 头像
  style: { type: Array, default: [] }, // 风格
  description: { type: String, default: '' } // 简介
})

module.exports = connection.model('songer', songerSchema)
